package com.mayisoftware.mayioa.business.po.impl.serviceImpl;


import com.mayisoftware.mayioa.business.po.api.domain.POBasicInfo;
import com.mayisoftware.mayioa.business.po.api.domain.POSearchInfo;
import com.mayisoftware.mayioa.business.po.api.service.IPOService;
import com.mayisoftware.mayioa.business.po.impl.dao.POMapper;
import com.mayisoftware.mayioa.common.impl.support.Convert;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class POServiceImpl implements IPOService {

    @Autowired
    private POMapper poMapper;

    @Override
    public List<POBasicInfo> queryPOInfos(POSearchInfo searchInfo) {
        return poMapper.queryPOInfos(searchInfo);
    }

    @Override
    public POBasicInfo getPoInfo(String po) {
        return poMapper.getPoInfo(po);
    }

    @Override
    public int insertPoInfo(POBasicInfo poBasicInfo) {
        return poMapper.insertPoInfo(poBasicInfo);
    }

    @Override
    public int deletePos(String ids) {
        String[] poCodes = Convert.toStrArray(ids);
        return poMapper.deletePo(poCodes);
    }

    @Override
    public int updatePoInfo(POBasicInfo poBasicInfo) {
        return poMapper.updatePoInfo(poBasicInfo);
    }


}
